<template>
  <div id="dictTableTop"> 
    <el-row :gutter="24">
      <el-col :span="8">
        <el-input v-model="params.dictName" placeholder="字典名称" /> 
      </el-col>
      <el-col :span="8">
        <el-input v-model="params.dictCode" placeholder="字典编码" /> 
      </el-col>
      <el-col :span="4">
        <el-button type="primary" round @click="selectDictInfo">
          <i class="iconfont icon-sousuo size" />
          查询
        </el-button>
      </el-col>
      <el-col :span="4">
        <el-button type="primary" round @click="addDict">
          <i class="iconfont icon-tianjia size" />
          新建
        </el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "dictTableTop",
  props: ["parentId"],
  data() {
    return {
      params: {
        dictName: '',
        dictCode:'',
        parentId : 0,
        type: 0
      }
    }
  },
  methods: {
    selectDictInfo() {
      this.$emit("selectDict",this.params)
    },
    addDict() {
      this.$emit('addDict')
    },
    receiveParentTop(query) {
      this.params.dictName = ''
      this.params.dictCode = ''
      this.params.parentId = query.parentId
      this.params.type = query.type
      this.selectDictInfo()
    }
  },
}
</script>

<style lang="scss" scoped>

.el-input /deep/ .el-input__inner{ 
  height: 32px;
  font-size: 13px;
  box-shadow: none;
  border: 1px solid #e9e9e9;
}


.el-button {
  line-height: 0px;
  height: 32px;
  padding: 12px;
  border-radius: 20px;
  margin-left: 12px;
  .size {
    font-size: 4px;
  }
}

</style>